package com.ruoyi.ftrl.domain.Dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;

@Data
@ApiModel("实时数据传输对象")
public class RealDataDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("数据类型（可选）")
    private String type;

    @ApiModelProperty("设备序列号（可选）")
    private String sn;

    @ApiModelProperty(value = "数据时间戳（必传）", required = true, example = "2022-08-25 13:45:22")
    @JsonProperty("time")
    private String time;

    @ApiModelProperty(value = "数据项列表", required = true)
    private List<DataItem> data;

    @Data
    @ApiModel("数据项")
    public static class DataItem implements Serializable {
        private static final long serialVersionUID = 1L;

        @ApiModelProperty(value = "数据标识（必传）", required = true, example = "C2.D1._io_status")
        private String id;

        @ApiModelProperty("数据描述（可选）")
        private String desc;

        @ApiModelProperty(value = "数据质量/状态（必传）", required = true, example = "0")
        private String quality;

        @ApiModelProperty(value = "数据值（必传）", required = true, example = "1.000")
        private String value;
    }
}
